import { PAGE_SIZE_BASE } from '@/constants/common';
import Xhr from './axios/xhr';

const saveAccessCode = code => Xhr.post('/access_code', code);
const getAccessCodeList = (index = 1, size=PAGE_SIZE_BASE, keyword = '') => Xhr.get(`/access_code/list?pageSize=${size}&pageIndex=${index}&keyword=${keyword}`);
const deleteAccessCodeById = id => Xhr.delete(`/access_code/${id}`);

export {
  saveAccessCode,
  getAccessCodeList,
  deleteAccessCodeById
};
